{extend name="layout/base"/}
{block name="content"}
{load href="__PLUG__/waterfall/waterfall.css"/}
{load href="__PLUG__/waterfall/waterfall.js"/}
<div class="page-title">
    <h3 class="ui header">精彩瞬间</h3>
    <div style="float: right;">
        <a class="ui tiny submit button" href="javascript:;" data-title="腾讯云视频列表"
           data-url="{:url('tencent/vodList')}" onclick="openBigWin(this)">腾讯云视频列表</a>
        <a class="ui teal tiny submit button" href="javascript:;" data-title="添加图片"
           data-url="{:url('saveMoment',['type' => 1])}" onclick="openBigWin(this)">添加图片</a>
        <a class="ui teal tiny submit button" href="javascript:;" data-title="添加视频"
           data-url="{:url('saveMoment',['type' => 2])}" onclick="openBigWin(this)">添加视频</a>
    </div>
</div>
<div style="clear: both;"></div>
<div class="wall">
    {volist name='data' id='v'}
    <div class="article" id="">
        {notempty name="v.video_url"}
        <a href="javascript:;" data-url="{:url('previewMoment', ['id' => $v.id])}" data-title="{$v.title}" onclick="openBigWin(this, {$v.id})">
            <div class="ui fluid image">
                <span class="ui left corner label">
                    <i class="play circle icon"></i>
                </span>
            {notempty name="v.images"}<img src="{$v.images[0]}" style="cursor: pointer"/> {/notempty}
            </div>
        </a>
        {else/}
        <a href="javascript:;" data-url="{:url('previewMoment', ['id' => $v.id])}" data-title="{$v.title}" onclick="openBigWin(this, {$v.id})">
            <div class="ui fluid image">
                <span class="ui left corner label">
                    <i class="image icon"></i>
                </span>
                {notempty name="v.images"}<img src="{$v.images[0]}" style="cursor: pointer"/> {/notempty}
            </div>
        {/notempty}
        <p style="margin-top: 10px;margin-bottom: 5px;">{$v.content|strip_tags}</p>
        {notempty name="v.clazz"}
        <p style="margin-bottom: 5px;">班级:{$v.clazz.name}</p>
        {/notempty}
        {notempty name="v.student_ids"}
        <p style="margin-bottom: 5px;">学员:{:app\\common\\model\\Student::getNameStrByIds($v.student_ids)}</p>
        {/notempty}
        <p style="margin-top: 10px;">
            {notempty name="v.video_url"}
            <a class="ui tiny teal label" data-title="编辑" data-url="{:url('saveMoment',['type' => 2])}" onclick="openBigWin(this, '{$v.id}')">修改</a>
            {else/}
            <a class="ui tiny teal label" data-title="编辑" data-url="{:url('saveMoment',['type' => 1])}" onclick="openBigWin(this, '{$v.id}')">修改</a>
            {/notempty}
            <a class="ui tiny label" data-title="删除" data-url="{:url('delMoment')}" onclick="delOne(this, '{$v.id}')">删除</a>
        </p>
    </div>
    {/volist}
</div>
<div style="clear: both;"></div>
<div style="margin: 10px;">
    <div class="ui tiny label popuper" data-content="信息总数" data-variation="mini">
        <i class="list icon"></i>{$data->total()}
    </div>
    <div style="float:right;" class="pager">
        {$data|raw}
    </div>
</div>
{/block}
{block name="script"}
<script>
    $(function () {
        $('.wall').jaliswall({item: '.article'});
    });
</script>
{/block}
